﻿@using ZX.Tools
@using ZX.Model
@model ZX.Model.Project_Task
@{
    ViewBag.Title = "关闭-指效OA";
    int userId = Session["UserId"].ToInt();
}
<link type="text/css" rel="stylesheet" href="/Static/styles/bootstrap.min.css">
<link href="~/Static/styles/theme/zui/css/min.css" rel="stylesheet" />
<link href="~/Static/js/Validform/css/style.css" rel="stylesheet" />
<link href="~/Static/js/jquery/chosen/chosen.min.css" rel="stylesheet" />
<link href="~/Static/js/layui/css/layui.css" rel="stylesheet" />
<link href="~/Static/js/layer/need/layer.css" rel="stylesheet" />
<script src="/Static/js/jquery/jquery-1.11.1.min.js"></script>
<script src="~/Static/js/jquery/form/min.js"></script>
<script src="~/Static/js/Validform/js/Validform_v5.3.2_min.js"></script>
<script src="~/Static/js/jquery/chosen/chosen.min.js"></script>
<script src="~/Static/js/zui/zui.min.js"></script>
<script src="~/Static/js/layui/layui.js"></script>
<script src="~/Static/js/layer/layer.js"></script>
<script src="~/Static/js/layer/layer.tools.js"></script>
<style>
    .col-sm-2 {
        width: 14%;
    }
</style>
<form id="doTaskForm" method="post" class="form-horizontal" style="padding-top: 38px;" action="/Project_Task/CloseSave">
    <input type="hidden" id="FK_TaskId" name="Id" value="@Model.Id">
    <input type="hidden" id="ExpectHours" name="TExpected" value="@Model.TExpected">
    <input type="hidden" id="FK_ProjectId" name="FK_ProjectId" value="@Model.FK_ProjectId">
    <input type="hidden" id="secondMenuId" name="secondMenuId" value="@ViewBag.SecondMenuId" />

    <div class="form-group">
        <label for="LogRemark" class="col-sm-2">
            描述
        </label>
        <div class="col-md-6 col-sm-10">
            <textarea name="LogRemark" id="LogTextRemark" class='form-control' rows='5' placeholder="描述" autocomplete="off" datatype="*" nullmsg="请填写关闭描述"></textarea>
        </div>
    </div>
    @{
        try
        {
            bool bl = true;
            //判断是否指派或者自己创建
            if (Model.Assigned == (userId + "") || Model.CreateUserId == userId)
            {

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        @Html.Raw(ViewBag.CurrentBtnList29)
                        <span id="spmsg"></span>
                    </div>
                </div>
                bl = false;
            }
            //是否已经开发权限，如没有，继续走角色设定权限
            if (bl)
            {
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        @Html.Raw(ViewBag.CurrentBtnList29)
                        <span id="spmsg"></span>
                    </div>
                </div>
            }
        }
        catch { }
    }

</form>
<script type="text/javascript">

    function saveData() {
        $("#doTaskForm").submit();
    }

    $("#doTaskForm").Validform({
        tiptype: function (msg, o, cssctl) {
            var objtip = $("#spmsg");
            cssctl(objtip, o.type);
            objtip.text(msg);
        },
        callback: function (form) {
            win.showLoading("正在保存...");
            $("#doTaskForm").ajaxSubmit(function (data) {
                if (data.Code == 300) {
                    win.alert("保存失败");
                } else if (data.Code == 200) {
                    win.success("保存成功", function () {
                        win.hideLoading();
                        window.parent.location.reload();//刷新当前页面.
                        win.close();
                    });
                }
            });
            return false;
        }
    });
</script>

